- main_toolbar do |t|
  = t.edit resource
  = t.export(:balance_sheet, :income_statement, :trial_balance, key: :code)
  = t.compute_balances resource, method: :post
  = t.new(label: :new_financial_year_exchange.tl, params: { controller: :financial_year_exchanges, financial_year_id: resource.id }) if resource.can_create_exchange?
  - attrs = {}
  - attrs["data-confirm"] = :are_you_sure.tl if resource.last_journal_entry
  -# = t.generate_last_journal_entry resource, attrs
  - if resource == resource_model.closable
    = t.close resource

= main_informations attachment: true do
  = attributes_list do |l|
    - l.attribute :currency
    - l.attribute :started_on
    - l.attribute :stopped_on
    - l.attribute :closed
    - l.attribute :code
    - l.attribute :accountant, url: true
    - l.attribute :last_journal_entry, url: true

= cobbles do |c|
  - c.cobble(resource.closed ? :balance : :last_computed_balance) do
    = cobble_list :account_balances

  - c.cobble(:fixed_asset_depreciations) do
    = cobble_list :fixed_asset_depreciations

  - c.cobble(:exchanges) do
    = cobble_list :exchanges
